#include <iostream>
#include <cstring>
class Person 
{

private:
char* name;
char* adress;
bool gender; //hmm
int birth_year;

public:
    void set_name(char* p_name) {name = p_name;}
    void set_adress(char* p_adress) {name = p_adress;}
    void set_gender(char p_gender) {gender = p_gender;}
    void set_birth_year(int p_birth_year) {birth_year = p_birth_year;}
    char* get_name() {return name;}
    char* get_adress() {return adress;}
    char get_gender() {return gender;}
    int get_birth_year() {return birth_year;}
    int print()
    {
        std::cout<<"Name "<<name<<" Adress "<<adress<<" Gender "<<gender<<" Birth Year "<<birth_year<<std::endl;
        return 0;
    }

    Person(char* p_name, char* p_adress, bool p_gender, int p_birth_year)
    {
        name = p_name;
        adress = p_adress;
        gender = p_gender;
        birth_year = p_birth_year;
    }

    Person(const Person &p)
    {
        name = p.name;
        adress = p.adress;
        gender = p.gender;
        birth_year = p.birth_year;
    }
    ~Person() {
    if (name!=nullptr)
    {
        delete[] name;
    }
    if (adress!=nullptr)
    {
        delete[] adress;
    }
    }
Person& operator = (Person& A)
{
    set_birth_year(A.get_birth_year());
    return *this;
}
};



std::ostream& operator << (std::ostream &stream, Person &B)
{
    stream << "Name: ";
    stream << B.get_name();
    return stream;
}

int main()
{   setlocale(LC_ALL, "Russian");
    char* n = new char [100] {"Kir"};
    char* nb = new char [100] {"Moskaw"};
    char* nn = new char [100] {"Nothing"};
    char* nw = new char [100] {"Nowhere"};
    Person Kir(n, nb, true, 2005);
    Person Kirvelikii{Kir};
    Kirvelikii.set_name(new char [100] {"Kirvelikii"});
    Kir.print();
    Kirvelikii.print();
    std::cout<<Kir;
    Person Nothing(nn, nw, false, 9999);
    Kir = Nothing;
    std::cout<<(Kir.get_name())<<std::endl;
    Kirvelikii = Kir;
    Kirvelikii.print();
    return 0;
}
